<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE xsl:stylesheet  [
	<!ENTITY nbsp   "&#160;">
	<!ENTITY copy   "&#169;">
	<!ENTITY reg    "&#174;">
	<!ENTITY trade  "&#8482;">
	<!ENTITY mdash  "&#8212;">
	<!ENTITY ldquo  "&#8220;">
	<!ENTITY rdquo  "&#8221;"> 
	<!ENTITY pound  "&#163;">
	<!ENTITY yen    "&#165;">
	<!ENTITY euro   "&#8364;">
]>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:page="urn:page">
  <xsl:output method="html" encoding="utf-8"/>
  <xsl:param name="param"/>
  <xsl:template name="main"  match="/">
    <xsl:param name="pid"/>
    <xsl:variable name="topid">
    <xsl:choose>
    <xsl:when test="$pid=''">0</xsl:when>
    <xsl:otherwise><xsl:value-of select="$pid"/></xsl:otherwise>
    </xsl:choose>
    </xsl:variable>
    <ul>
    <xsl:for-each select="//rows/row[F_ParentID=$topid]">
    <xsl:sort select="F_Order" data-type="number" order="ascending"/>
      <xsl:variable name="id" select="ID"/>
      <li><xsl:attribute name="class"><xsl:if test="count(//rows/row[F_ParentID=$id])=0"> Child</xsl:if></xsl:attribute><a href="javascript:void(0);//{ID}/{page:xRequest('siteid',$param)}" onclick="TM.closeChildTab(0);TM.tQuery('catalogid={ID}&amp;siteid={page:xRequest('siteid',$param)}')"><xsl:if test="page:xRequest('catalogid')=string(ID)"><xsl:attribute name="class">current</xsl:attribute></xsl:if><xsl:value-of select="F_Name"/></a>
        <xsl:if test="count(//rows/row[F_ParentID=$id])&gt;0">
          <xsl:call-template name="main">
          <xsl:with-param name="pid" select="ID"/>
          </xsl:call-template>
        </xsl:if></li>
    </xsl:for-each>
    </ul>
  </xsl:template>
</xsl:stylesheet>
